This is an open assessment looking at potential health effects of a national fish promotion program in Finland. The details of the assessment are described at Opasnet. This file contains the R code to run the assessment model.

Knit to html for best performance.

Calculation is based on BONUS GOHERR project and its http://en.opasnet.org/w/Goherr_assessment.

What needs to be done for PFAS assessment?

  1. Amount should be gender and age-specific, because we need to worry about young mothers. Solution: take KKE amounts of fish, and scale those with the Goherr subgroup-specific proportions. DONE
  2. Amounts should reflect the actual fish consumption in Porvoo. Solution: postpone and use national statistics. DONE
  3. Infant’s dioxin concentration module must be added. Solution: Use Goherr model for expo_indir DONE
  4. The module must be updated to match PFAS as well. Solution: update the module to contain column Exposure_agent. Change body fat parameter to volume of distribution.
  5. Find why expo_indir is so much higher than EFSA toxicokinetic assessment. Make an alternative model.
  6. Add ERF for PFAS (sum of PFOS, PFHxS, PFOA, PFNA). Solution: Make a new page for ERF of PFAS and add that to adjusted ERFs. First immunology; postpone cholesterol and low birth weight and liver toxicity. DONE
  7. Add case burdens for PFAS outcomes. Solution: give rough estimates for immunology to get started. DONE
  8. Add PFAS concentrations to data. Solution: Look at Porvoo concentrations first and make conc_pfas; combine that with conc_vit. DONE
  9. Add dioxin and MeHg concentrations. Later.
  10. Now that the model runs technically, look through each part to check that it makes sense.
  11. If PAF contains some inputs with Age and some without Age (implying that they apply to any age group), only the explicit age groups remain in the end. Add RRorig to compensate for this. DONE
  12. TEQ and MeHg are missing from dose. Check why and correct.
objects.latest("Op_en2261", code_name="RR2") # RR on page [[Health impact assessment]]
## Loading objects:
##   RR
RRorig <- RR@formula

RR@formula <- function(...) {
  out <- RRorig()
  out <- out * Ovariable(output=data.frame(Age=c(
    "0 - 4", "5 - 9", "10 - 14", "15 - 19", "20 - 24", "25 - 29", "30 - 34", "35 - 39", "40 - 44", "45 - 49", "50 - 54",
    "55 - 59", "60 - 64", "65 - 69", "70 - 74", "75 - 79", "80 - 84", "85+"),
    Result=1),
    marginal=c(TRUE,FALSE)
  )
  return(out)
}
# This code was forked from https://github.com/jtuomist/fishhealth/blob/master/fishhealth.Rmd
# This code was previously forked from code Op_fi5923/model on page [[Kotimaisen kalan edistämisohjelma]]
# The code was even more previously forked from Op_fi5889/model on page [[Ruori]] and Op_en7748/model on page [[Goherr assessment]]

dat <- opbase.data("Op_fi5932", subset="Malliparametrit")[-1] # [[PFAS-yhdeisteiden tautitaakka]]
dec <- opbase.data("Op_fi5932", subset="Decisions")[-1]
DecisionTableParser(dec)

CTable <- opbase.data("Op_fi5932",subset="CollapseMarginals")
#for(i in 1:ncol(CTable)) {CTable[[i]] <- as.character(CTable[[i]])} # The default is currently character, not factor
CollapseTableParser(CTable)

cat("Laskennassa käytetty data.\n")
## Laskennassa käytetty data.
dat
cat("Tarkastellut päätökset.\n")
## Tarkastellut päätökset.
dec
cat("Aggregoidut marginaalit.\n")
## Aggregoidut marginaalit.
CTable
dummy <- Ovariable("dummy",data=data.frame(Age="dummy", Fish="dummy", Compound="dummy", Area="dummy", Result=1)) # Keep these columns marginals

fish_proportion <- Ovariable( # How population subgroups eat fish differently
  "fish_proportion",
  data = data.frame(prepare(dat,"fish proportion",c("Type","Exposure_agent","Response","Unit"))),
  unit="proportion of the mean")

total_amount <- Ovariable(
  "total_amount",
  data=prepare(dat, "amount", c("Type","Response","Exposure_agent","Unit")),
  unit="M kg/a")

amount <- Ovariable(
  "amount",
  dependencies = data.frame(Name=c("total_amount", "fish_proportion")),
  formula = function(...) {
    amount <- total_amount
      # Filleted weight, i.e. no loss.
    amount <- amount * 1000 / 5.52 /365.25 
      # M kg/a per 5.52M population --> g/d per average person.
    amount <- amount * fish_proportion
      # fish_proportion tells the relative amount in each subgroup
  
    # Match KKE-classification in amount with Fineli classification
    tmp <- Ovariable(
      output = data.frame(
        Kala = c("Kasvatettu", "Kaupallinen", "Kirjolohi", "Silakka", "Vapaa-ajan", "Muu tuonti", "Tuontikirjolohi", "Tuontilohi"),
        Fish = c("Whitefish", "Average fish","Rainbow trout", "Herring", "Average fish", "Average fish", "Rainbow trout", "Salmon"),
        Result = 1
      ),
      marginal = c(TRUE, TRUE, FALSE)
    )
    
    amount <- amount * tmp
    
    return(amount)
  },
  unit="g/d"
)
# Exposure:To child and To eater not needed, because dioxins are not (yet) included

population <- Ovariable(
  "population", 
  data=prepare(dat, "population", c("Type", "Exposure_agent", "Response","Unit")),
  unit = "#"
)

incidence <- Ovariable(
  "incidence",
  data = prepare(dat,"incidence",c("Type","Exposure_agent","Unit")),
  unit="1/person-year")
#incidence@data$Age[is.na(incidence@data$Age)] <- ""

case_burden <- Ovariable(
  "case_burden",
  data = prepare(dat,"case burden",c("Type", "Exposure_agent","Unit")),
  unit="DALY/case")

ERFchoice <- Ovariable(
  "ERFchoice",
  data = 
    prepare(dat, "ERFchoice", c("Unit", "Type"))
)

InpBoD <- EvalOutput(Ovariable( # Evaluated because is not a dependency but an Input
  "InpBoD",
  data = prepare(dat, "BoD", c("Type","Exposure_agent","Unit")),
  unit="DALY/a"
))
InpBoD$Response[InpBoD$Response=="All causes"] <- "All-cause mortality"
InpBoD$Response[InpBoD$Response=="Depressive disorders"] <- "Depression"
InpBoD$Response[InpBoD$Response=="Neoplasms"] <- "Cancer morbidity"
InpBoD$Response[InpBoD$Response=="Respiratory infections and tuberculosis"] <- "Immunosuppression" # Infections of 0-9-year-olds are assumed to represent the background BoD of immunosuppressive effect of PFAS
InpBoD$Response[InpBoD$Response=="Cardiovascular diseases"] <- "CHD2 mortality"
conc_vit <- Ovariable(
  "conc_vit",
  ddata = "Op_en1838", # [[Concentrations of beneficial nutrients in fish]]
  subset = "Fineli data for common fish species",
  unit="ALA mg/g, DHA mg/g, Fish g/g, Omega3 mg/g, Vitamin D µg/g f.w. after adjustment"
)
  df = conc_vit@data
  df$Nutrient[df$Nutrient=="D-vitamiini (µg)"] <- "Vitamin D"
  df$Nutrient[df$Nutrient=="rasvahapot n-3 moni-tyydyttymättömät (g)"] <- "Omega3"
  df$Nutrient[df$Nutrient=="rasvahappo 18:3 n-3 (alfalinoleenihappo) (mg)"] <- "ALA"
  df$Nutrient[df$Nutrient=="rasvahappo 22:6 n-3 (DHA) (mg)"] <- "DHA"
  df$Nutrient[df$Nutrient=="proteiini (g)"] <- "Fish"
  df$conc_vitResult[df$Nutrient=="Fish"] <- "1"
  df <- dropall(df[df$Nutrient %in% c("Vitamin D", "Omega3", "ALA", "DHA", "Fish") , ])
conc_vit@data <- df

######## Concentration of PFAS

# Data from EU-kalat3 (Finland excl Vanhankaupunginlahti): # pg/g fresh weight
#       POP     mean       sd      min   Q0.025   median   Q0.975      max
# 2.5% PFOS 2055.757 1404.045 305.0399 330.1365 1533.269 5029.697 5814.935

# Data from EU-kalat3 (Vanhankaupunginlahti, Helsinki) # ng/g f.w.
#      POP   mean       sd      min   Q0.025   median   Q0.975      max
#2.5% PFOS 14.428 11.94542 1.499441 1.607789 15.64988 35.32517 38.91994

conc_eukalat <- EvalOutput(Ovariable(
  "conc_eukalat",
  data = data.frame(
    Area = c("Suomi","Helsinki"),
    Compound="PFOS",
    Result=c("2.056 (3.301 - 5.030)", "14.428 (1.499 - 35.325)")),
  unit="ng/g fresh weight"
))

conc_pfas_raw <- Ovariable(
  "conc_pfas_raw",
  ddata="Op_fi5932",subset="PFAS concentrations",
  unit="ng/g f.w.")

conc_pfas <- Ovariable(
  "conc_pfas",
  dependencies = data.frame(Name="conc_pfas_raw"),
  formula = function(...) {
    out <- conc_pfas_raw
    out$Source <- NULL
    out$Area <- "Porvoo"
    out <- expand_index(out, list(Fish=list(Perch=c(
      "Average fish", "Pike","Rainbow trout","Roach", "Salmon", "Vendace", "Whitefish"))))
    out@marginal <- c(TRUE, TRUE, FALSE, TRUE, TRUE)
    return(out)
  },
  unit="ng/g fresh weight"
)

#sum_pfas <- oapply(conc_pfas, cols=c("Kala","Compound"), FUN=sum)
#tmp <- conc_pfas / sum_pfas
#summary(tmp, marginals="Compound")
#
## This tells that PFOS consists of 71 - 97 % of the four key PFAS, while PFOA, PFNA, and PFHxS consist of 
# 0 - 10 %, 2 - 18 %, and 0 - 9 %, respectively.
# Even if we included the next most abundant congeners, i.e. PFDA and PFUnA, the overall picture would not change.

conc <- Ovariable(
  "conc",
  dependencies = data.frame(Name=c("conc_vit", "conc_pfas")),
  formula = function(...){
    conc_vit <- oapply(conc_vit, cols=c("Kala", "Adjust"),FUN=mean)
    colnames(conc_vit@output)[colnames(conc_vit@output)=="Nutrient"] <- "Compound"

    conc_pfas <- oapply(conc_pfas, cols=c("Obs","Area"), FUN=mean)
    conc_pfas$Compound[conc_pfas$Compound %in% c("PFOA","PFNA","PFHxS","PFOS")] <- "PFAS"
    conc_pfas <- oapply(conc_pfas, cols="", FUN=sum)
    
    out <- OpasnetUtils::combine(conc_vit, conc_pfas)
    return(out)
  }
)
###################################################################
# Code copied from http://en.opasnet.org/w/Goherr_assessment#

mc2dparam<- list(
  N2 = 10, # Number of iterations in the new Iter
  strength = 50, # Sample size to which the fun is to be applied. Resembles number of observations
  run2d = FALSE, # Should the mc2d function be used or not?
  info = 1, # Ovariable that contains additional indices, e.g. newmarginals.
  newmarginals = c("Exposure"), # Names of columns that are non-marginals but should be sampled enough to become marginals
  method = "bootstrap", # which method to use for 2D Monte Carlo? Currently bootsrap is the only option.
  fun = mean # Function for aggregating the first Iter dimension.
)

if(FALSE) {
## Exposure with background exposure but without mother's exposure to child

expo_dir <- Ovariable(
  "expo_dir",
  dependencies=data.frame(Name=c("amount","conc","expo_bg")),
  formula = function(...) {
    out <- conc[conc$Exposure_agent=="TEQ",] * 0 + 1
    out$Exposure_agent <- "Fish"
    out <- combine(conc, out, name="conc")
    out <- oapply(amount * out, cols="Fish", FUN=sum)
    out <- Ovariable(output = data.frame(
      Exposcen = c("BAU", "No exposure"),
      Result = c(1, 0)
    ), marginal=c(TRUE,FALSE)) * out + expo_bg
    out$Exposure <- as.factor(
      ifelse(
        out$Exposure_agent %in% c("DHA", "MeHg"),
        "To child",
        "To eater"
      )
    )
    return(out)
  },
  unit = "PCDDF, PCB, TEQ: pg /d; Vitamin D, MeHg: µg /d; DHA, EPA, Omega3: mg /d; Fish: g /d"
)

## Background-exposure to vitamin D and omega-3
addexposure <- Ovariable(
  "addexposure",
  ddata = "Op_en7748", # [[Benefit-risk assessment of Baltic herring and salmon intake]]
  subset = "Background exposure",
  unit = "PCDDF, PCB, TEQ: pg /d; Vitamin D, MeHg: µg /d; DHA, EPA, Omega3: mg /d"
)

# Should the background be specific for gender and country? At the moment it is.
expo_bg <- Ovariable(
  "expo_bg",
  dependencies = data.frame(Name="addexposure","info"),
  formula = function(...) {
    out <- addexposure
    
    # Empty values ("") in indices must be replaced by NA so that Ops works correctly.
    levels(out$Gender)[levels(out$Gender) == ""] <- NA
    levels(out$Country)[levels(out$Country) == ""] <- NA
    levels(out$Exposure_agent)[levels(out$Exposure_agent) == ""] <- NA
    out@output <- fillna(out@output, c("Country", "Gender", "Exposure_agent"))
    
    temp1 <- out[out$Exposure_agent %in% c("PCDDF","PCB") , ]
    temp1 <- oapply(temp1, cols = "Exposure_agent", FUN = sum)
    temp1$Exposure_agent <- "TEQ"
    
    temp2 <- out[out$Exposure_agent %in% c("EPA", "DHA") , ]
    temp2 <- oapply(temp2, cols = "Exposure_agent", FUN = sum)
    temp2$Exposure_agent <- "Omega3"
    
    out <- OpasnetUtils::combine(out, temp1, temp2)
    out <- unkeep(out * info, prevresults = TRUE, sources = TRUE)
    
    return(out)
  },
  unit = "PCDDF, PCB, TEQ: pg /d; Vitamin D, MeHg: µg /d; DHA, EPA, Omega3: mg /d"
)

# Stores non-marginal columns for further use.
info <- Ovariable(
  "info",
  dependencies = data.frame(Name = c("jsp")),
  formula = function(...) {
    out <- jsp
    out$Group <- factor(
      paste(out$Gender, out$Ages),
      levels = c("Female 18-45", "Male 18-45", "Female >45", "Male >45")
    )
    out$Country <- factor(out$Country, ordered=FALSE)
    out <- unique(out@output[c("Iter","Country","Group","Gender","Row")])
    out$Result <- 1
    return(out)
  }
)

} # END IF
############################### Code from Goherr assessment ends

expo_dir <- Ovariable(
  "expo_dir",
  dependencies = data.frame(Name=c("conc", "amount")),
  formula = function(...) {
    
    conc$Fish[conc$Fish %in% c("Perch","Pike-perch","Eel","")] <- "Average fish"
    conc <- oapply(conc, cols="", FUN=mean)
    out <- conc * amount 
    
#    colnames(out@output)[colnames(out@output)=="Nutrient"] <- "Exposure_agent"
      
    return(out)
  },
  unit="ng/d"
)

exposure <- Ovariable(
  "exposure",
  dependencies = data.frame(
    Name = c(
      "expo_dir", # direct exposure, i.e. the person eats or breaths the exposure agent themself
      "expo_indir", # indirect exposure, i.e. the person (typically fetus or infant) is exposed via someone else (mother)
      "mc2d" # 2D Monte Carlo function
    ),
    Ident = c(
      NA,
      "Op_en7797/expo_indir2", # [[Infant's dioxin exposure]] # expo_indir
      "Op_en7805/mc2d") # [[Two-dimensional Monte Carlo]]
  ),
  formula = function(...) {
    out <- OpasnetUtils::combine(expo_dir, expo_indir)
    out <- unkeep(out, "Source.1", sources=TRUE)
    out <- mc2d(out)
    out$Exposure[is.na(out$Exposure)] <- "Direct"
    return(out)
  },
  unit = "PCDDF, PCB, TEQ: (To eater: pg /day; to child: pg /g fat); Vitamin D, MeHg: µg /day; DHA, EPA, Omega3: mg /day"
)

exposure <- Ovariable(
  "exposure",
  dependencies=data.frame(Name=c("amount","conc")),
  formula = function(...) {
    out <- amount * conc
    colnames(out@output)[colnames(out@output)=="Compound"] <- "Exposure_agent"
    return(out)
  }
)
objects.latest("Op_en2261",code_name="BoDattr2") # [[Health impact assessment]]
## Loading objects:
##   BoDattr
tryCatch(BoDattr <- EvalOutput(BoDattr, verbose=TRUE))
##  Evaluating BoDattr ...
## 
##  - BoD fetched successfully!
## 
##  - PAF fetched successfully!
## - Evaluating BoD ...
## - - Evaluating incidence ...
## 
##  done(0.01 secs)!
## - - Checking incidence marginals ... Response, Age, incidenceSource recognized as marginal(s).
## Loading required package: reshape2
## 
## Attaching package: 'reshape2'
## The following object is masked from 'package:tidyr':
## 
##     smiths
## - - Processing incidence decisions ... done!
## - - Evaluating case_burden ...
## 
##  done(0 secs)!
## - - Checking case_burden marginals ... Response, case_burdenSource recognized as marginal(s).
## - - Processing case_burden marginal collapses ... done!
## - - Evaluating population ...
## 
##  done(0 secs)!
## - - Checking population marginals ... Gender, Age, populationSource recognized as marginal(s).
## 
## - done(0.3 secs)!
## - Checking BoD marginals ... Response, Age, incidenceSource, Adjust, Gender, populationSource, BoDSource recognized as marginal(s).
## - Processing BoD inputs ... done!
## - Processing BoD marginal collapses ...
## Warning in oapply(variable, FUN = fun[[i]], cols = cols[[i]], na.rm = TRUE):
## While oapplying BoD, found NAs in indices: Adjust, InpBoDSource. They were
## automatically filled using fillna, which may result in a multiplied population.
## Please check your ovariable before using oapply.
##  done!
## - Evaluating PAF ...
## 
##  - - dose fetched successfully!
## 
##  - - ERF fetched successfully!
## 
##  - - frexposed fetched successfully!
## 
##  - - P_illness fetched successfully!
## 
##  - - sumExposcen fetched successfully!
## 
##  - - mc2d fetched successfully!
## - - Evaluating dose ...
## 
##  - - - BW fetched successfully!
## - - - Evaluating exposure ...
## - - - - Evaluating amount ...
## - - - - - Evaluating total_amount ...
## 
##  done(0.01 secs)!
## - - - - - Checking total_amount marginals ... Kala, Scenario, total_amountSource recognized as marginal(s).
## - - - - - Evaluating fish_proportion ...
## 
##  done(0 secs)!
## - - - - - Checking fish_proportion marginals ... Gender, fish_proportionSource recognized as marginal(s).
## 
## ---- done(0.14 secs)!
## - - - - Checking amount marginals ... Kala, Scenario, total_amountSource, Gender, fish_proportionSource, Fish, amountSource recognized as marginal(s).
## - - - - Evaluating conc ...
## - - - - - Evaluating conc_vit ...
## 
##  done(0.01 secs)!
## - - - - - Checking conc_vit marginals ... Kala, Fish, Nutrient, conc_vitSource recognized as marginal(s).
## - - - - - Processing conc_vit decisions ... done!
## - - - - - Evaluating conc_pfas ...
## - - - - - - Evaluating conc_pfas_raw ...
## 
##  done(0.03 secs)!
## - - - - - - Checking conc_pfas_raw marginals ... Fish, Compound, conc_pfas_rawSource recognized as marginal(s).
## 
## ----- done(0.09 secs)!
## - - - - - Checking conc_pfas marginals ... Fish, Compound, conc_pfas_rawSource, Area, conc_pfasSource recognized as marginal(s).
## 
## ---- done(0.22 secs)!
## - - - - Checking conc marginals ... Fish, Compound, conc_pfas_rawSource, concSource recognized as marginal(s).
## 
## --- done(0.46 secs)!
## - - - Checking exposure marginals ... Kala, Scenario, total_amountSource, Gender, fish_proportionSource, Fish, amountSource, Exposure_agent, conc_pfas_rawSource, concSource, exposureSource recognized as marginal(s).
## - - - Processing exposure marginal collapses ...
## Warning in oapply(variable, FUN = fun[[i]], cols = cols[[i]], na.rm = TRUE):
## While oapplying exposure, found NAs in indices: conc_pfas_rawSource. They were
## automatically filled using fillna, which may result in a multiplied population.
## Please check your ovariable before using oapply.
##  done!
## - - - Evaluating BW ...
## 
##  done(0 secs)!
## - - - Checking BW marginals ... BWSource recognized as marginal(s).
## 
## -- done(25.3 secs)!
## - - Checking dose marginals ... Scenario, total_amountSource, Gender, fish_proportionSource, amountSource, Exposure_agent, conc_pfas_rawSource, concSource, Scaling, exposureSource, BWSource, doseSource recognized as marginal(s).
## - - Processing dose marginal collapses ... done!
## - - Evaluating ERF ...
## 
##  - - - ERF_env fetched successfully!
## 
##  - - - ERF_omega3 fetched successfully!
## 
##  - - - ERF_mehg fetched successfully!
## 
##  - - - ERF_diox fetched successfully!
## 
##  - - - ERF_vit fetched successfully!
## 
##  - - - ERF_micr fetched successfully!
## 
##  - - - ERF_pfas fetched successfully!
## - - - Evaluating ERF_env ...
## 
##  done(0.02 secs)!
## - - - Checking ERF_env marginals ... Exposure_agent, Response, Subgroup, Exposure, ER_function, Scaling, Exposure_unit, Observation, ERF_envSource recognized as marginal(s).
## - - - Evaluating ERF_omega3 ...
## 
##  done(0 secs)!
## - - - Checking ERF_omega3 marginals ... Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling, Observation, ERF_omega3Source recognized as marginal(s).
## - - - Evaluating ERF_mehg ...
## 
##  done(0 secs)!
## - - - Checking ERF_mehg marginals ... Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling, Observation, ERF_mehgSource recognized as marginal(s).
## - - - Evaluating ERF_diox ...
## 
##  done(0 secs)!
## - - - Checking ERF_diox marginals ... Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling, Observation, ERF_dioxSource recognized as marginal(s).
## - - - Evaluating ERF_vit ...
## 
##  done(0 secs)!
## - - - Checking ERF_vit marginals ... Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling, Observation, ERF_vitSource recognized as marginal(s).
## - - - Evaluating ERF_micr ...
## 
##  done(0 secs)!
## - - - Checking ERF_micr marginals ... Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling, Observation, ERF_micrSource recognized as marginal(s).
## - - - Evaluating ERF_pfas ...
## 
##  done(0 secs)!
## - - - Checking ERF_pfas marginals ... Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling, Observation, ERF_pfasSource recognized as marginal(s).
## - - - Evaluating ERFchoice ...
## 
##  done(0 secs)!
## - - - Checking ERFchoice marginals ... Exposure_agent, Response, Scaling, Exposure, ER_function, ERFchoiceSource recognized as marginal(s).
## 
## -- done(2.92 mins)!
## - - Checking ERF marginals ... Exposure_agent, Response, Exposure, ER_function, Scaling, Observation, ERFSource recognized as marginal(s).
## - - Processing ERF marginal collapses ... done!
## - - Evaluating RR ...
## - - - Processing dose marginal collapses ... done!
## - - - Processing ERF marginal collapses ... done!
## 
## -- done(0.16 secs)!
## - - Checking RR marginals ... Exposure_agent, Response, ER_function, Scaling, ERFSource, Scenario, total_amountSource, Gender, fish_proportionSource, amountSource, conc_pfas_rawSource, doseSource, Age, RRSource recognized as marginal(s).
## - - Evaluating frexposed ...
## 
##  done(0 secs)!
## - - Checking frexposed marginals ... frexposedSource recognized as marginal(s).
## - - Evaluating P_illness ...
## 
##  done(0 secs)!
## - - Checking P_illness marginals ... Response, Illness, Age, P_illnessSource recognized as marginal(s).
## 
## - done(5.85 mins)!
## - Checking PAF marginals ... Exposure_agent, Response, ER_function, Scaling, ERFSource, Scenario, total_amountSource, Gender, fish_proportionSource, amountSource, conc_pfas_rawSource, doseSource, frexposedSource, Age, incidenceSource, Adjust, RRSource, PAFSource recognized as marginal(s).
## - Processing PAF marginal collapses ...
## Warning in oapply(variable, FUN = fun[[i]], cols = cols[[i]], na.rm = TRUE):
## While oapplying PAF, found NAs in indices: Adjust. They were automatically
## filled using fillna, which may result in a multiplied population. Please check
## your ovariable before using oapply.
##  done!
## 
##  done(6.66 mins)!
##  Checking BoDattr marginals ... Response, Age, Gender, Adjust, InpBoDSource, Exposure_agent, Scenario, total_amountSource, fish_proportionSource, amountSource, conc_pfas_rawSource, PAFSource, BoDattrSource recognized as marginal(s).
oprint(summary(amount,"mean"))
##               Kala Scenario Gender          Fish       mean
## 1      Kaupallinen      BAU Female  Average fish  1.2697279
## 2       Muu tuonti      BAU Female  Average fish 11.1101191
## 3       Vapaa-ajan      BAU Female  Average fish  3.9282207
## 4      Kaupallinen      BAU   Male  Average fish  1.9045919
## 5       Muu tuonti      BAU   Male  Average fish 16.6651787
## 6       Vapaa-ajan      BAU   Male  Average fish  5.8923310
## 7          Silakka      BAU Female       Herring  0.6348640
## 8          Silakka      BAU   Male       Herring  0.9522959
## 9        Kirjolohi      BAU Female Rainbow trout  2.6584928
## 10 Tuontikirjolohi      BAU Female Rainbow trout  1.9045919
## 11       Kirjolohi      BAU   Male Rainbow trout  3.9877392
## 12 Tuontikirjolohi      BAU   Male Rainbow trout  2.8568878
## 13      Tuontilohi      BAU Female        Salmon  9.3642433
## 14      Tuontilohi      BAU   Male        Salmon 14.0463649
## 15      Kasvatettu      BAU Female     Whitefish  0.2380740
## 16      Kasvatettu      BAU   Male     Whitefish  0.3571110
oprint(summary(BoD,marginals=c("Age","Response"),"mean"))
##           Age                                          Response       mean
## 1       0 - 4                                  Cancer morbidity   309.5200
## 2     10 - 14                                  Cancer morbidity   347.0750
## 3     15 - 19                                  Cancer morbidity   414.9750
## 4     20 - 24                                  Cancer morbidity   569.5250
## 5     25 - 29                                  Cancer morbidity   795.4550
## 6     30 - 34                                  Cancer morbidity  1147.9850
## 7     35 - 39                                  Cancer morbidity  1679.1250
## 8     40 - 44                                  Cancer morbidity  2452.5650
## 9     45 - 49                                  Cancer morbidity  3849.3800
## 10      5 - 9                                  Cancer morbidity   345.5200
## 11    50 - 54                                  Cancer morbidity  6987.9000
## 12    55 - 59                                  Cancer morbidity 11237.3300
## 13    60 - 64                                  Cancer morbidity 16331.9100
## 14    65 - 69                                  Cancer morbidity 21899.6500
## 15    70 - 74                                  Cancer morbidity 25551.8600
## 16    75 - 79                                  Cancer morbidity 18015.2300
## 17    80 - 84                                  Cancer morbidity 14650.9150
## 18    85 - 89                                  Cancer morbidity  8413.0550
## 19    90 - 94                                  Cancer morbidity  3537.1750
## 20  Undefined      Dioxin recommendation tolerable daily intake   305.4067
## 21  Undefined Dioxin recommendation tolerable daily intake 2018   888.4560
## 22      0 - 4                                 Immunosuppression   295.9850
## 23      5 - 9                                 Immunosuppression   261.5350
## 24      0 - 4                         Loss in child's IQ points 16778.3774
## 25  Undefined                                          PFAS TWI  2776.4249
## 26      0 - 4                               Sperm concentration  4478.6700
## 27  Undefined                          Vitamin D recommendation   610.8135
## 28      0 - 4                           Yes or no dental defect   343.9619
## 29      0 - 4                               All-cause mortality  4867.4650
## 30    10 - 14                               All-cause mortality  1085.5450
## 31    15 - 19                               All-cause mortality  2965.9450
## 32    20 - 24                               All-cause mortality  5274.8450
## 33    25 - 29                               All-cause mortality  6263.5400
## 34    30 - 34                               All-cause mortality  6710.3100
## 35    35 - 39                               All-cause mortality  8275.6450
## 36    40 - 44                               All-cause mortality 10232.0150
## 37    45 - 49                               All-cause mortality 13691.2800
## 38      5 - 9                               All-cause mortality   931.1250
## 39    50 - 54                               All-cause mortality 21321.8650
## 40    55 - 59                               All-cause mortality 29861.9100
## 41    60 - 64                               All-cause mortality 39200.8750
## 42    65 - 69                               All-cause mortality 49295.5050
## 43    70 - 74                               All-cause mortality 59799.7000
## 44    75 - 79                               All-cause mortality 49428.5150
## 45    80 - 84                               All-cause mortality 51968.9150
## 46    85 - 89                               All-cause mortality 42765.3450
## 47    90 - 94                               All-cause mortality 26756.6400
## 48      0 - 4                                        Depression     0.4150
## 49    10 - 14                                        Depression   555.8850
## 50    15 - 19                                        Depression  1320.8250
## 51    20 - 24                                        Depression  1841.0150
## 52    25 - 29                                        Depression  1801.4650
## 53    30 - 34                                        Depression  1590.0200
## 54    35 - 39                                        Depression  1721.7250
## 55    40 - 44                                        Depression  1700.2800
## 56    45 - 49                                        Depression  1534.1700
## 57      5 - 9                                        Depression    76.4850
## 58    50 - 54                                        Depression  1718.9550
## 59    55 - 59                                        Depression  1767.1650
## 60    60 - 64                                        Depression  1676.7400
## 61    65 - 69                                        Depression  1561.5750
## 62    70 - 74                                        Depression  1426.2350
## 63    75 - 79                                        Depression   799.7000
## 64    80 - 84                                        Depression   581.2950
## 65    85 - 89                                        Depression   363.0750
## 66    90 - 94                                        Depression   186.1150
## 67      0 - 4                                    CHD2 mortality    53.6100
## 68    10 - 14                                    CHD2 mortality    75.3150
## 69    15 - 19                                    CHD2 mortality   145.3450
## 70    20 - 24                                    CHD2 mortality   254.1000
## 71    25 - 29                                    CHD2 mortality   437.6450
## 72    30 - 34                                    CHD2 mortality   636.4200
## 73    35 - 39                                    CHD2 mortality  1168.2600
## 74    40 - 44                                    CHD2 mortality  1977.5650
## 75    45 - 49                                    CHD2 mortality  3117.3100
## 76      5 - 9                                    CHD2 mortality    48.7800
## 77    50 - 54                                    CHD2 mortality  5476.2900
## 78    55 - 59                                    CHD2 mortality  8747.4650
## 79    60 - 64                                    CHD2 mortality 13077.9700
## 80    65 - 69                                    CHD2 mortality 18100.7500
## 81    70 - 74                                    CHD2 mortality 24549.2850
## 82    75 - 79                                    CHD2 mortality 23413.4850
## 83    80 - 84                                    CHD2 mortality 27899.3350
## 84    85 - 89                                    CHD2 mortality 25240.0350
## 85    90 - 94                                    CHD2 mortality 16630.6150
## 86    15 - 19                                     Breast cancer     2.0900
## 87    20 - 24                                     Breast cancer     7.7850
## 88    25 - 29                                     Breast cancer    36.8200
## 89    30 - 34                                     Breast cancer   145.1600
## 90    35 - 39                                     Breast cancer   263.6000
## 91    40 - 44                                     Breast cancer   433.3500
## 92    45 - 49                                     Breast cancer   704.9550
## 93    50 - 54                                     Breast cancer  1045.3250
## 94    55 - 59                                     Breast cancer  1341.8150
## 95    60 - 64                                     Breast cancer  1513.2150
## 96    65 - 69                                     Breast cancer  1649.3300
## 97    70 - 74                                     Breast cancer  1678.0350
## 98    75 - 79                                     Breast cancer  1232.0100
## 99    80 - 84                                     Breast cancer   950.8800
## 100   85 - 89                                     Breast cancer   578.1900
## 101   90 - 94                                     Breast cancer   296.1800
oprint(summary(BoDattr,marginals=c("Age","Response"),"mean"))
##          Age                  Response          mean
## 1      0 - 4         Immunosuppression  6.818641e+00
## 2      5 - 9         Immunosuppression  7.294478e+00
## 3      0 - 4 Loss in child's IQ points -3.292014e+03
## 4  Undefined                  PFAS TWI  1.370935e+03
## 5  Undefined  Vitamin D recommendation  6.108135e+02
## 6      0 - 4       All-cause mortality -3.940215e+02
## 7    10 - 14       All-cause mortality -8.729181e+01
## 8    15 - 19       All-cause mortality -2.510075e+02
## 9    20 - 24       All-cause mortality -4.582433e+02
## 10   25 - 29       All-cause mortality -5.472993e+02
## 11   30 - 34       All-cause mortality -5.805901e+02
## 12   35 - 39       All-cause mortality -7.164739e+02
## 13   40 - 44       All-cause mortality -8.793680e+02
## 14   45 - 49       All-cause mortality -1.166310e+03
## 15     5 - 9       All-cause mortality -7.424681e+01
## 16   50 - 54       All-cause mortality -1.808052e+03
## 17   55 - 59       All-cause mortality -2.535812e+03
## 18   60 - 64       All-cause mortality -3.319267e+03
## 19   65 - 69       All-cause mortality -4.145066e+03
## 20   70 - 74       All-cause mortality -4.980650e+03
## 21   75 - 79       All-cause mortality -4.044850e+03
## 22   80 - 84       All-cause mortality -4.134937e+03
## 23     0 - 4                Depression -7.647127e-02
## 24   10 - 14                Depression -9.937062e+01
## 25   15 - 19                Depression -2.347323e+02
## 26   20 - 24                Depression -3.276647e+02
## 27   25 - 29                Depression -3.226701e+02
## 28   30 - 34                Depression -2.865779e+02
## 29   35 - 39                Depression -3.110681e+02
## 30   40 - 44                Depression -3.073361e+02
## 31   45 - 49                Depression -2.766914e+02
## 32     5 - 9                Depression -1.387565e+01
## 33   50 - 54                Depression -3.090770e+02
## 34   55 - 59                Depression -3.166728e+02
## 35   60 - 64                Depression -2.997941e+02
## 36   65 - 69                Depression -2.791761e+02
## 37   70 - 74                Depression -2.551780e+02
## 38   75 - 79                Depression -1.425020e+02
## 39   80 - 84                Depression -1.024717e+02
## 40     0 - 4            CHD2 mortality -8.359787e+00
## 41   10 - 14            CHD2 mortality -1.170566e+01
## 42   15 - 19            CHD2 mortality -2.262663e+01
## 43   20 - 24            CHD2 mortality -3.966234e+01
## 44   25 - 29            CHD2 mortality -6.844631e+01
## 45   30 - 34            CHD2 mortality -9.964232e+01
## 46   35 - 39            CHD2 mortality -1.833859e+02
## 47   40 - 44            CHD2 mortality -3.106654e+02
## 48   45 - 49            CHD2 mortality -4.899542e+02
## 49     5 - 9            CHD2 mortality -7.579246e+00
## 50   50 - 54            CHD2 mortality -8.613391e+02
## 51   55 - 59            CHD2 mortality -1.375930e+03
## 52   60 - 64            CHD2 mortality -2.055932e+03
## 53   65 - 69            CHD2 mortality -2.841726e+03
## 54   70 - 74            CHD2 mortality -3.847268e+03
## 55   75 - 79            CHD2 mortality -3.660036e+03
## 56   80 - 84            CHD2 mortality -4.346514e+03
## 57   15 - 19             Breast cancer -4.624153e-01
## 58   20 - 24             Breast cancer -1.587543e+00
## 59   25 - 29             Breast cancer -7.326368e+00
## 60   30 - 34             Breast cancer -2.873340e+01
## 61   35 - 39             Breast cancer -5.218217e+01
## 62   40 - 44             Breast cancer -8.577757e+01
## 63   45 - 49             Breast cancer -1.395958e+02
## 64   50 - 54             Breast cancer -2.070689e+02
## 65   55 - 59             Breast cancer -2.658472e+02
## 66   60 - 64             Breast cancer -2.998331e+02
## 67   65 - 69             Breast cancer -3.267095e+02
## 68   70 - 74             Breast cancer -3.327787e+02
## 69   75 - 79             Breast cancer -2.441402e+02
## 70   80 - 84             Breast cancer -1.884558e+02
oprint(summary(BoDattr,marginals=c("Exposure_agent","Response"),"mean"))
##   Exposure_agent                  Response         mean
## 1           PFAS         Immunosuppression     7.056559
## 2            DHA Loss in child's IQ points -3292.013959
## 3           PFAS                  PFAS TWI  1370.934688
## 4      Vitamin D  Vitamin D recommendation   610.813471
## 5           Fish       All-cause mortality -1771.969747
## 6           Fish                Depression  -228.525606
## 7         Omega3            CHD2 mortality -1190.045495
## 8         Omega3             Breast cancer  -155.749901
oprint(summary(BoDattr,marginals=c("Gender","Response"),"mean"))
##    Gender                  Response         mean
## 1  Female         Immunosuppression     5.205862
## 2    Male         Immunosuppression     8.907256
## 3  Female Loss in child's IQ points -2561.773339
## 4    Male Loss in child's IQ points -4022.254579
## 5  Female                  PFAS TWI     0.000000
## 6    Male                  PFAS TWI  2741.869376
## 7  Female  Vitamin D recommendation   618.415679
## 8    Male  Vitamin D recommendation   603.211263
## 9  Female       All-cause mortality -1003.248948
## 10   Male       All-cause mortality -2540.690546
## 11 Female                Depression  -235.343301
## 12   Male                Depression  -221.707910
## 13 Female            CHD2 mortality  -815.643510
## 14   Male            CHD2 mortality -1564.447480
## 15 Female             Breast cancer  -308.799252
## 16   Male             Breast cancer    -2.700550
oprint(summary(case_burden,"mean"))
##                                            Response        mean
## 1      Dioxin recommendation tolerable daily intake 0.001004988
## 2 Dioxin recommendation tolerable daily intake 2018 0.001004988
## 3                         Loss in child's IQ points 0.110000000
## 4                                          PFAS TWI 0.001004988
## 5                               Sperm concentration 2.500000000
## 6                          Vitamin D recommendation 0.001004988
## 7                           Yes or no dental defect 0.060000000
oprint(summary(conc,"mean"))
##             Fish  Compound      mean
## 1   Average fish       ALA  0.690000
## 2          Bream       ALA  0.220000
## 3        Herring       ALA  1.740000
## 4           Pike       ALA  0.080000
## 5  Rainbow trout       ALA  4.810000
## 6          Roach       ALA  0.100000
## 7         Salmon       ALA  7.960000
## 8        Vendace       ALA  1.350000
## 9      Whitefish       ALA  2.220000
## 10  Average fish       DHA  2.540000
## 11         Bream       DHA  2.730000
## 12       Herring       DHA  5.860000
## 13          Pike       DHA  0.300000
## 14 Rainbow trout       DHA  7.570000
## 15         Roach       DHA  2.870000
## 16        Salmon       DHA  6.690000
## 17       Vendace       DHA  3.000000
## 18     Whitefish       DHA  3.940000
## 19  Average fish      Fish  1.000000
## 20         Bream      Fish  1.000000
## 21       Herring      Fish  1.000000
## 22          Pike      Fish  1.000000
## 23 Rainbow trout      Fish  1.000000
## 24         Roach      Fish  1.000000
## 25        Salmon      Fish  1.000000
## 26       Vendace      Fish  1.000000
## 27     Whitefish      Fish  1.000000
## 28  Average fish    Omega3  7.000000
## 29         Bream    Omega3  6.000000
## 30       Herring    Omega3 24.000000
## 31          Pike    Omega3  0.500000
## 32 Rainbow trout    Omega3 18.000000
## 33         Roach    Omega3  5.000000
## 34        Salmon    Omega3 23.000000
## 35       Vendace    Omega3 10.000000
## 36     Whitefish    Omega3 10.000000
## 37  Average fish      PFAS  8.793125
## 38         Bream      PFAS  4.950000
## 39           Eel      PFAS  7.895000
## 40       Herring      PFAS  1.655000
## 41         Perch      PFAS  8.793125
## 42          Pike      PFAS  8.793125
## 43    Pike-perch      PFAS  2.595000
## 44 Rainbow trout      PFAS  8.793125
## 45         Roach      PFAS  8.793125
## 46        Salmon      PFAS  8.793125
## 47       Vendace      PFAS  8.793125
## 48     Whitefish      PFAS  8.793125
## 49  Average fish Vitamin D  0.105000
## 50         Bream Vitamin D  0.140000
## 51       Herring Vitamin D  0.156000
## 52          Pike Vitamin D  0.021000
## 53 Rainbow trout Vitamin D  0.051000
## 54         Roach Vitamin D  0.100000
## 55        Salmon Vitamin D  0.067000
## 56       Vendace Vitamin D  0.094000
## 57     Whitefish Vitamin D  0.144000
oprint(summary(dose,"mean"))
##    Scenario Gender Exposure_agent Scaling         mean
## 1       BAU Female            ALA      BW   1.56247954
## 2       BAU   Male            ALA      BW   2.34371931
## 3       BAU Female            DHA      BW   2.04671635
## 4       BAU   Male            DHA      BW   3.07007453
## 5       BAU Female           Fish      BW   0.44440477
## 6       BAU   Male           Fish      BW   0.66660715
## 7       BAU Female         Omega3      BW   6.13267239
## 8       BAU   Male         Omega3      BW   9.19900859
## 9       BAU Female           PFAS      BW   3.84296754
## 10      BAU   Male           PFAS      BW   5.76445130
## 11      BAU Female      Vitamin D      BW   0.03865415
## 12      BAU   Male      Vitamin D      BW   0.05798122
## 13      BAU Female            ALA   Log10   2.03891238
## 14      BAU   Male            ALA   Log10   2.21500364
## 15      BAU Female            DHA   Log10   2.15615570
## 16      BAU   Male            DHA   Log10   2.33224696
## 17      BAU Female           Fish   Log10   1.49287675
## 18      BAU   Male           Fish   Log10   1.66896801
## 19      BAU Female         Omega3   Log10   2.63274781
## 20      BAU   Male         Omega3   Log10   2.80883906
## 21      BAU Female           PFAS   Log10   2.42976476
## 22      BAU   Male           PFAS   Log10   2.60585601
## 23      BAU Female      Vitamin D   Log10   0.43229411
## 24      BAU   Male      Vitamin D   Log10   0.60838537
## 25      BAU Female            ALA    None 109.37356784
## 26      BAU   Male            ALA    None 164.06035175
## 27      BAU Female            DHA    None 143.27014453
## 28      BAU   Male            DHA    None 214.90521680
## 29      BAU Female           Fish    None  31.10833358
## 30      BAU   Male           Fish    None  46.66250037
## 31      BAU Female         Omega3    None 429.28706762
## 32      BAU   Male         Omega3    None 643.93060143
## 33      BAU Female           PFAS    None 269.00772748
## 34      BAU   Male           PFAS    None 403.51159123
## 35      BAU Female      Vitamin D    None   2.70579016
## 36      BAU   Male      Vitamin D    None   4.05868524
oprint(summary(ERF,"mean"))
##    Exposure_agent                                          Response
## 1            Fish                               All-cause mortality
## 2          Omega3                                     Breast cancer
## 3            Fish                                        Depression
## 4             DHA                         Loss in child's IQ points
## 5             TEQ                               Sperm concentration
## 6             TEQ                           Yes or no dental defect
## 7          Omega3                                    CHD2 mortality
## 8       Vitamin D                          Vitamin D recommendation
## 9            MeHg                         Loss in child's IQ points
## 10           PFAS                                 Immunosuppression
## 11           PFAS                                          PFAS TWI
## 12            TEQ                                  Cancer morbidity
## 13            TEQ      Dioxin recommendation tolerable daily intake
## 14            TEQ Dioxin recommendation tolerable daily intake 2018
## 15           Fish                               All-cause mortality
## 16         Omega3                                     Breast cancer
## 17           Fish                                        Depression
## 18            DHA                         Loss in child's IQ points
## 19            TEQ                               Sperm concentration
## 20            TEQ                           Yes or no dental defect
## 21         Omega3                                    CHD2 mortality
## 22      Vitamin D                          Vitamin D recommendation
## 23           MeHg                         Loss in child's IQ points
## 24           PFAS                                 Immunosuppression
## 25           PFAS                                          PFAS TWI
## 26            TEQ                                  Cancer morbidity
## 27            TEQ      Dioxin recommendation tolerable daily intake
## 28            TEQ Dioxin recommendation tolerable daily intake 2018
##      ER_function Scaling Observation          mean
## 1             RR    None         ERF   0.997871700
## 2             RR    None         ERF   0.999487200
## 3             RR    None         ERF   0.994690400
## 4            ERS    None         ERF  -0.001300000
## 5            ERS    None         ERF   0.000060000
## 6            ERS    None         ERF   0.001390971
## 7  Relative Hill    None         ERF  -0.170000000
## 8           Step    None         ERF 100.000000000
## 9            ERS      BW         ERF   9.800000000
## 10           ERS      BW         ERF   0.022700000
## 11           TWI      BW         ERF   4.400000000
## 12           CSF      BW         ERF   0.000500000
## 13           TDI      BW         ERF   2.000000000
## 14           TDI      BW         ERF   0.288900000
## 15            RR    None   Threshold   0.000000000
## 16            RR    None   Threshold   0.000000000
## 17            RR    None   Threshold   0.000000000
## 18           ERS    None   Threshold   0.000000000
## 19           ERS    None   Threshold   0.000000000
## 20           ERS    None   Threshold   0.000000000
## 21 Relative Hill    None   Threshold  47.000000000
## 22          Step    None   Threshold  10.000000000
## 23           ERS      BW   Threshold   0.000000000
## 24           ERS      BW   Threshold   0.000000000
## 25           TWI      BW   Threshold   0.000000000
## 26           CSF      BW   Threshold   0.000000000
## 27           TDI      BW   Threshold   0.000000000
## 28           TDI      BW   Threshold   0.000000000
oprint(summary(expo_dir,"mean"))
## Warning in oapply(conc, cols = "", FUN = mean): While oapplying conc, found NAs
## in indices: conc_pfas_rawSource. They were automatically filled using fillna,
## which may result in a multiplied population. Please check your ovariable before
## using oapply.
##             Fish  Compound            Kala Scenario Gender         mean
## 1      Whitefish       ALA      Kasvatettu      BAU Female   0.52852424
## 2      Whitefish       DHA      Kasvatettu      BAU Female   0.93801149
## 3      Whitefish      Fish      Kasvatettu      BAU Female   0.23807398
## 4      Whitefish    Omega3      Kasvatettu      BAU Female   2.38073981
## 5      Whitefish      PFAS      Kasvatettu      BAU Female   2.09341428
## 6      Whitefish Vitamin D      Kasvatettu      BAU Female   0.03428265
## 7   Average fish       ALA     Kaupallinen      BAU Female   0.87611225
## 8   Average fish       DHA     Kaupallinen      BAU Female   3.22510887
## 9   Average fish      Fish     Kaupallinen      BAU Female   1.26972790
## 10  Average fish    Omega3     Kaupallinen      BAU Female   8.88809531
## 11  Average fish      PFAS     Kaupallinen      BAU Female   8.91229950
## 12  Average fish Vitamin D     Kaupallinen      BAU Female   0.13332143
## 13 Rainbow trout       ALA       Kirjolohi      BAU Female  12.78735034
## 14 Rainbow trout       DHA       Kirjolohi      BAU Female  20.12479045
## 15 Rainbow trout      Fish       Kirjolohi      BAU Female   2.65849279
## 16 Rainbow trout    Omega3       Kirjolohi      BAU Female  47.85287028
## 17 Rainbow trout      PFAS       Kirjolohi      BAU Female  23.37645944
## 18 Rainbow trout Vitamin D       Kirjolohi      BAU Female   0.13558313
## 19  Average fish       ALA      Muu tuonti      BAU Female   7.66598220
## 20  Average fish       DHA      Muu tuonti      BAU Female  28.21970261
## 21  Average fish      Fish      Muu tuonti      BAU Female  11.11011914
## 22  Average fish    Omega3      Muu tuonti      BAU Female  77.77083395
## 23  Average fish      PFAS      Muu tuonti      BAU Female  77.98262060
## 24  Average fish Vitamin D      Muu tuonti      BAU Female   1.16656251
## 25       Herring       ALA         Silakka      BAU Female   1.10466327
## 26       Herring       DHA         Silakka      BAU Female   3.72030275
## 27       Herring      Fish         Silakka      BAU Female   0.63486395
## 28       Herring    Omega3         Silakka      BAU Female  15.23673482
## 29       Herring      PFAS         Silakka      BAU Female   1.05069984
## 30       Herring Vitamin D         Silakka      BAU Female   0.09903878
## 31 Rainbow trout       ALA Tuontikirjolohi      BAU Female   9.16108681
## 32 Rainbow trout       DHA Tuontikirjolohi      BAU Female  14.41776032
## 33 Rainbow trout      Fish Tuontikirjolohi      BAU Female   1.90459185
## 34 Rainbow trout    Omega3 Tuontikirjolohi      BAU Female  34.28265333
## 35 Rainbow trout      PFAS Tuontikirjolohi      BAU Female  16.74731423
## 36 Rainbow trout Vitamin D Tuontikirjolohi      BAU Female   0.09713418
## 37        Salmon       ALA      Tuontilohi      BAU Female  74.53937644
## 38        Salmon       DHA      Tuontilohi      BAU Female  62.64678749
## 39        Salmon      Fish      Tuontilohi      BAU Female   9.36424327
## 40        Salmon    Omega3      Tuontilohi      BAU Female 215.37759525
## 41        Salmon      PFAS      Tuontilohi      BAU Female  82.34096162
## 42        Salmon Vitamin D      Tuontilohi      BAU Female   0.62740430
## 43  Average fish       ALA      Vapaa-ajan      BAU Female   2.71047228
## 44  Average fish       DHA      Vapaa-ajan      BAU Female   9.97768056
## 45  Average fish      Fish      Vapaa-ajan      BAU Female   3.92822069
## 46  Average fish    Omega3      Vapaa-ajan      BAU Female  27.49754486
## 47  Average fish      PFAS      Vapaa-ajan      BAU Female  27.57242657
## 48  Average fish Vitamin D      Vapaa-ajan      BAU Female   0.41246317
## 49     Whitefish       ALA      Kasvatettu      BAU   Male   0.79278636
## 50     Whitefish       DHA      Kasvatettu      BAU   Male   1.40701723
## 51     Whitefish      Fish      Kasvatettu      BAU   Male   0.35711097
## 52     Whitefish    Omega3      Kasvatettu      BAU   Male   3.57110972
## 53     Whitefish      PFAS      Kasvatettu      BAU   Male   3.14012142
## 54     Whitefish Vitamin D      Kasvatettu      BAU   Male   0.05142398
## 55  Average fish       ALA     Kaupallinen      BAU   Male   1.31416838
## 56  Average fish       DHA     Kaupallinen      BAU   Male   4.83766330
## 57  Average fish      Fish     Kaupallinen      BAU   Male   1.90459185
## 58  Average fish    Omega3     Kaupallinen      BAU   Male  13.33214296
## 59  Average fish      PFAS     Kaupallinen      BAU   Male  13.36844925
## 60  Average fish Vitamin D     Kaupallinen      BAU   Male   0.19998214
## 61 Rainbow trout       ALA       Kirjolohi      BAU   Male  19.18102550
## 62 Rainbow trout       DHA       Kirjolohi      BAU   Male  30.18718567
## 63 Rainbow trout      Fish       Kirjolohi      BAU   Male   3.98773919
## 64 Rainbow trout    Omega3       Kirjolohi      BAU   Male  71.77930542
## 65 Rainbow trout      PFAS       Kirjolohi      BAU   Male  35.06468916
## 66 Rainbow trout Vitamin D       Kirjolohi      BAU   Male   0.20337470
## 67  Average fish       ALA      Muu tuonti      BAU   Male  11.49897331
## 68  Average fish       DHA      Muu tuonti      BAU   Male  42.32955391
## 69  Average fish      Fish      Muu tuonti      BAU   Male  16.66517870
## 70  Average fish    Omega3      Muu tuonti      BAU   Male 116.65625093
## 71  Average fish      PFAS      Muu tuonti      BAU   Male 116.97393090
## 72  Average fish Vitamin D      Muu tuonti      BAU   Male   1.74984376
## 73       Herring       ALA         Silakka      BAU   Male   1.65699491
## 74       Herring       DHA         Silakka      BAU   Male   5.58045413
## 75       Herring      Fish         Silakka      BAU   Male   0.95229593
## 76       Herring    Omega3         Silakka      BAU   Male  22.85510222
## 77       Herring      PFAS         Silakka      BAU   Male   1.57604976
## 78       Herring Vitamin D         Silakka      BAU   Male   0.14855816
## 79 Rainbow trout       ALA Tuontikirjolohi      BAU   Male  13.74163021
## 80 Rainbow trout       DHA Tuontikirjolohi      BAU   Male  21.62664048
## 81 Rainbow trout      Fish Tuontikirjolohi      BAU   Male   2.85688778
## 82 Rainbow trout    Omega3 Tuontikirjolohi      BAU   Male  51.42398000
## 83 Rainbow trout      PFAS Tuontikirjolohi      BAU   Male  25.12097134
## 84 Rainbow trout Vitamin D Tuontikirjolohi      BAU   Male   0.14570128
## 85        Salmon       ALA      Tuontilohi      BAU   Male 111.80906467
## 86        Salmon       DHA      Tuontilohi      BAU   Male  93.97018123
## 87        Salmon      Fish      Tuontilohi      BAU   Male  14.04636491
## 88        Salmon    Omega3      Tuontilohi      BAU   Male 323.06639288
## 89        Salmon      PFAS      Tuontilohi      BAU   Male 123.51144243
## 90        Salmon Vitamin D      Tuontilohi      BAU   Male   0.94110645
## 91  Average fish       ALA      Vapaa-ajan      BAU   Male   4.06570842
## 92  Average fish       DHA      Vapaa-ajan      BAU   Male  14.96652085
## 93  Average fish      Fish      Vapaa-ajan      BAU   Male   5.89233104
## 94  Average fish    Omega3      Vapaa-ajan      BAU   Male  41.24631729
## 95  Average fish      PFAS      Vapaa-ajan      BAU   Male  41.35863985
## 96  Average fish Vitamin D      Vapaa-ajan      BAU   Male   0.61869476
#oprint(summary(exposure,"mean"))
#oprint(summary(fish_proportion,"mean"))
oprint(summary(incidence,"mean"))
##                                            Response       Age Adjust   mean
## 1                                 Immunosuppression     0 - 4    BAU 4.8100
## 2                         Loss in child's IQ points     0 - 4    BAU 1.1920
## 3                               Sperm concentration     0 - 4    BAU 0.0140
## 4                           Yes or no dental defect     0 - 4    BAU 0.0448
## 5                                 Immunosuppression     5 - 9    BAU 3.9500
## 6      Dioxin recommendation tolerable daily intake Undefined    BAU 0.1100
## 7 Dioxin recommendation tolerable daily intake 2018 Undefined    BAU 0.3200
## 8                                          PFAS TWI Undefined    BAU 1.0000
## 9                          Vitamin D recommendation Undefined    BAU 0.2200
oprint(summary(PAF,"mean"))
##     Exposure_agent                  Response Scenario Gender       Age Adjust
## 1              DHA Loss in child's IQ points      BAU Female     0 - 4    BAU
## 2             PFAS         Immunosuppression      BAU Female     0 - 4    BAU
## 3             Fish       All-cause mortality      BAU Female     0 - 4    BAU
## 4           Omega3             Breast cancer      BAU Female     0 - 4    BAU
## 5             Fish                Depression      BAU Female     0 - 4    BAU
## 6           Omega3            CHD2 mortality      BAU Female     0 - 4    BAU
## 7              DHA Loss in child's IQ points      BAU   Male     0 - 4    BAU
## 8             PFAS         Immunosuppression      BAU   Male     0 - 4    BAU
## 9             Fish       All-cause mortality      BAU   Male     0 - 4    BAU
## 10          Omega3             Breast cancer      BAU   Male     0 - 4    BAU
## 11            Fish                Depression      BAU   Male     0 - 4    BAU
## 12          Omega3            CHD2 mortality      BAU   Male     0 - 4    BAU
## 13            Fish       All-cause mortality      BAU Female   10 - 14    BAU
## 14          Omega3             Breast cancer      BAU Female   10 - 14    BAU
## 15            Fish                Depression      BAU Female   10 - 14    BAU
## 16          Omega3            CHD2 mortality      BAU Female   10 - 14    BAU
## 17            Fish       All-cause mortality      BAU   Male   10 - 14    BAU
## 18          Omega3             Breast cancer      BAU   Male   10 - 14    BAU
## 19            Fish                Depression      BAU   Male   10 - 14    BAU
## 20          Omega3            CHD2 mortality      BAU   Male   10 - 14    BAU
## 21            Fish       All-cause mortality      BAU Female   15 - 19    BAU
## 22          Omega3             Breast cancer      BAU Female   15 - 19    BAU
## 23            Fish                Depression      BAU Female   15 - 19    BAU
## 24          Omega3            CHD2 mortality      BAU Female   15 - 19    BAU
## 25            Fish       All-cause mortality      BAU   Male   15 - 19    BAU
## 26          Omega3             Breast cancer      BAU   Male   15 - 19    BAU
## 27            Fish                Depression      BAU   Male   15 - 19    BAU
## 28          Omega3            CHD2 mortality      BAU   Male   15 - 19    BAU
## 29            Fish       All-cause mortality      BAU Female   20 - 24    BAU
## 30          Omega3             Breast cancer      BAU Female   20 - 24    BAU
## 31            Fish                Depression      BAU Female   20 - 24    BAU
## 32          Omega3            CHD2 mortality      BAU Female   20 - 24    BAU
## 33            Fish       All-cause mortality      BAU   Male   20 - 24    BAU
## 34          Omega3             Breast cancer      BAU   Male   20 - 24    BAU
## 35            Fish                Depression      BAU   Male   20 - 24    BAU
## 36          Omega3            CHD2 mortality      BAU   Male   20 - 24    BAU
## 37            Fish       All-cause mortality      BAU Female   25 - 29    BAU
## 38          Omega3             Breast cancer      BAU Female   25 - 29    BAU
## 39            Fish                Depression      BAU Female   25 - 29    BAU
## 40          Omega3            CHD2 mortality      BAU Female   25 - 29    BAU
## 41            Fish       All-cause mortality      BAU   Male   25 - 29    BAU
## 42          Omega3             Breast cancer      BAU   Male   25 - 29    BAU
## 43            Fish                Depression      BAU   Male   25 - 29    BAU
## 44          Omega3            CHD2 mortality      BAU   Male   25 - 29    BAU
## 45            Fish       All-cause mortality      BAU Female   30 - 34    BAU
## 46          Omega3             Breast cancer      BAU Female   30 - 34    BAU
## 47            Fish                Depression      BAU Female   30 - 34    BAU
## 48          Omega3            CHD2 mortality      BAU Female   30 - 34    BAU
## 49            Fish       All-cause mortality      BAU   Male   30 - 34    BAU
## 50          Omega3             Breast cancer      BAU   Male   30 - 34    BAU
## 51            Fish                Depression      BAU   Male   30 - 34    BAU
## 52          Omega3            CHD2 mortality      BAU   Male   30 - 34    BAU
## 53            Fish       All-cause mortality      BAU Female   35 - 39    BAU
## 54          Omega3             Breast cancer      BAU Female   35 - 39    BAU
## 55            Fish                Depression      BAU Female   35 - 39    BAU
## 56          Omega3            CHD2 mortality      BAU Female   35 - 39    BAU
## 57            Fish       All-cause mortality      BAU   Male   35 - 39    BAU
## 58          Omega3             Breast cancer      BAU   Male   35 - 39    BAU
## 59            Fish                Depression      BAU   Male   35 - 39    BAU
## 60          Omega3            CHD2 mortality      BAU   Male   35 - 39    BAU
## 61            Fish       All-cause mortality      BAU Female   40 - 44    BAU
## 62          Omega3             Breast cancer      BAU Female   40 - 44    BAU
## 63            Fish                Depression      BAU Female   40 - 44    BAU
## 64          Omega3            CHD2 mortality      BAU Female   40 - 44    BAU
## 65            Fish       All-cause mortality      BAU   Male   40 - 44    BAU
## 66          Omega3             Breast cancer      BAU   Male   40 - 44    BAU
## 67            Fish                Depression      BAU   Male   40 - 44    BAU
## 68          Omega3            CHD2 mortality      BAU   Male   40 - 44    BAU
## 69            Fish       All-cause mortality      BAU Female   45 - 49    BAU
## 70          Omega3             Breast cancer      BAU Female   45 - 49    BAU
## 71            Fish                Depression      BAU Female   45 - 49    BAU
## 72          Omega3            CHD2 mortality      BAU Female   45 - 49    BAU
## 73            Fish       All-cause mortality      BAU   Male   45 - 49    BAU
## 74          Omega3             Breast cancer      BAU   Male   45 - 49    BAU
## 75            Fish                Depression      BAU   Male   45 - 49    BAU
## 76          Omega3            CHD2 mortality      BAU   Male   45 - 49    BAU
## 77            PFAS         Immunosuppression      BAU Female     5 - 9    BAU
## 78            Fish       All-cause mortality      BAU Female     5 - 9    BAU
## 79          Omega3             Breast cancer      BAU Female     5 - 9    BAU
## 80            Fish                Depression      BAU Female     5 - 9    BAU
## 81          Omega3            CHD2 mortality      BAU Female     5 - 9    BAU
## 82            PFAS         Immunosuppression      BAU   Male     5 - 9    BAU
## 83            Fish       All-cause mortality      BAU   Male     5 - 9    BAU
## 84          Omega3             Breast cancer      BAU   Male     5 - 9    BAU
## 85            Fish                Depression      BAU   Male     5 - 9    BAU
## 86          Omega3            CHD2 mortality      BAU   Male     5 - 9    BAU
## 87            Fish       All-cause mortality      BAU Female   50 - 54    BAU
## 88          Omega3             Breast cancer      BAU Female   50 - 54    BAU
## 89            Fish                Depression      BAU Female   50 - 54    BAU
## 90          Omega3            CHD2 mortality      BAU Female   50 - 54    BAU
## 91            Fish       All-cause mortality      BAU   Male   50 - 54    BAU
## 92          Omega3             Breast cancer      BAU   Male   50 - 54    BAU
## 93            Fish                Depression      BAU   Male   50 - 54    BAU
## 94          Omega3            CHD2 mortality      BAU   Male   50 - 54    BAU
## 95            Fish       All-cause mortality      BAU Female   55 - 59    BAU
## 96          Omega3             Breast cancer      BAU Female   55 - 59    BAU
## 97            Fish                Depression      BAU Female   55 - 59    BAU
## 98          Omega3            CHD2 mortality      BAU Female   55 - 59    BAU
## 99            Fish       All-cause mortality      BAU   Male   55 - 59    BAU
## 100         Omega3             Breast cancer      BAU   Male   55 - 59    BAU
## 101           Fish                Depression      BAU   Male   55 - 59    BAU
## 102         Omega3            CHD2 mortality      BAU   Male   55 - 59    BAU
## 103           Fish       All-cause mortality      BAU Female   60 - 64    BAU
## 104         Omega3             Breast cancer      BAU Female   60 - 64    BAU
## 105           Fish                Depression      BAU Female   60 - 64    BAU
## 106         Omega3            CHD2 mortality      BAU Female   60 - 64    BAU
## 107           Fish       All-cause mortality      BAU   Male   60 - 64    BAU
## 108         Omega3             Breast cancer      BAU   Male   60 - 64    BAU
## 109           Fish                Depression      BAU   Male   60 - 64    BAU
## 110         Omega3            CHD2 mortality      BAU   Male   60 - 64    BAU
## 111           Fish       All-cause mortality      BAU Female   65 - 69    BAU
## 112         Omega3             Breast cancer      BAU Female   65 - 69    BAU
## 113           Fish                Depression      BAU Female   65 - 69    BAU
## 114         Omega3            CHD2 mortality      BAU Female   65 - 69    BAU
## 115           Fish       All-cause mortality      BAU   Male   65 - 69    BAU
## 116         Omega3             Breast cancer      BAU   Male   65 - 69    BAU
## 117           Fish                Depression      BAU   Male   65 - 69    BAU
## 118         Omega3            CHD2 mortality      BAU   Male   65 - 69    BAU
## 119           Fish       All-cause mortality      BAU Female   70 - 74    BAU
## 120         Omega3             Breast cancer      BAU Female   70 - 74    BAU
## 121           Fish                Depression      BAU Female   70 - 74    BAU
## 122         Omega3            CHD2 mortality      BAU Female   70 - 74    BAU
## 123           Fish       All-cause mortality      BAU   Male   70 - 74    BAU
## 124         Omega3             Breast cancer      BAU   Male   70 - 74    BAU
## 125           Fish                Depression      BAU   Male   70 - 74    BAU
## 126         Omega3            CHD2 mortality      BAU   Male   70 - 74    BAU
## 127           Fish       All-cause mortality      BAU Female   75 - 79    BAU
## 128         Omega3             Breast cancer      BAU Female   75 - 79    BAU
## 129           Fish                Depression      BAU Female   75 - 79    BAU
## 130         Omega3            CHD2 mortality      BAU Female   75 - 79    BAU
## 131           Fish       All-cause mortality      BAU   Male   75 - 79    BAU
## 132         Omega3             Breast cancer      BAU   Male   75 - 79    BAU
## 133           Fish                Depression      BAU   Male   75 - 79    BAU
## 134         Omega3            CHD2 mortality      BAU   Male   75 - 79    BAU
## 135           Fish       All-cause mortality      BAU Female   80 - 84    BAU
## 136         Omega3             Breast cancer      BAU Female   80 - 84    BAU
## 137           Fish                Depression      BAU Female   80 - 84    BAU
## 138         Omega3            CHD2 mortality      BAU Female   80 - 84    BAU
## 139           Fish       All-cause mortality      BAU   Male   80 - 84    BAU
## 140         Omega3             Breast cancer      BAU   Male   80 - 84    BAU
## 141           Fish                Depression      BAU   Male   80 - 84    BAU
## 142         Omega3            CHD2 mortality      BAU   Male   80 - 84    BAU
## 143           Fish       All-cause mortality      BAU Female       85+    BAU
## 144         Omega3             Breast cancer      BAU Female       85+    BAU
## 145           Fish                Depression      BAU Female       85+    BAU
## 146         Omega3            CHD2 mortality      BAU Female       85+    BAU
## 147           Fish       All-cause mortality      BAU   Male       85+    BAU
## 148         Omega3             Breast cancer      BAU   Male       85+    BAU
## 149           Fish                Depression      BAU   Male       85+    BAU
## 150         Omega3            CHD2 mortality      BAU   Male       85+    BAU
## 151      Vitamin D  Vitamin D recommendation      BAU Female Undefined    BAU
## 152           PFAS                  PFAS TWI      BAU Female Undefined    BAU
## 153      Vitamin D  Vitamin D recommendation      BAU   Male Undefined    BAU
## 154           PFAS                  PFAS TWI      BAU   Male Undefined    BAU
##            mean
## 1   -0.15625100
## 2    0.01813625
## 3   -0.06412974
## 4   -0.19763757
## 5   -0.15262578
## 6   -0.15322440
## 7   -0.23437649
## 8    0.02720438
## 9   -0.09463548
## 10  -0.28128638
## 11  -0.21996719
## 12  -0.15843589
## 13  -0.06412974
## 14  -0.19763757
## 15  -0.15262578
## 16  -0.15322440
## 17  -0.09463548
## 18  -0.28128638
## 19  -0.21996719
## 20  -0.15843589
## 21  -0.06412974
## 22  -0.19763757
## 23  -0.15262578
## 24  -0.15322440
## 25  -0.09463548
## 26  -0.28128638
## 27  -0.21996719
## 28  -0.15843589
## 29  -0.06412974
## 30  -0.19763757
## 31  -0.15262578
## 32  -0.15322440
## 33  -0.09463548
## 34  -0.28128638
## 35  -0.21996719
## 36  -0.15843589
## 37  -0.06412974
## 38  -0.19763757
## 39  -0.15262578
## 40  -0.15322440
## 41  -0.09463548
## 42  -0.28128638
## 43  -0.21996719
## 44  -0.15843589
## 45  -0.06412974
## 46  -0.19763757
## 47  -0.15262578
## 48  -0.15322440
## 49  -0.09463548
## 50  -0.28128638
## 51  -0.21996719
## 52  -0.15843589
## 53  -0.06412974
## 54  -0.19763757
## 55  -0.15262578
## 56  -0.15322440
## 57  -0.09463548
## 58  -0.28128638
## 59  -0.21996719
## 60  -0.15843589
## 61  -0.06412974
## 62  -0.19763757
## 63  -0.15262578
## 64  -0.15322440
## 65  -0.09463548
## 66  -0.28128638
## 67  -0.21996719
## 68  -0.15843589
## 69  -0.06412974
## 70  -0.19763757
## 71  -0.15262578
## 72  -0.15322440
## 73  -0.09463548
## 74  -0.28128638
## 75  -0.21996719
## 76  -0.15843589
## 77   0.02208490
## 78  -0.06412974
## 79  -0.19763757
## 80  -0.15262578
## 81  -0.15322440
## 82   0.03312735
## 83  -0.09463548
## 84  -0.28128638
## 85  -0.21996719
## 86  -0.15843589
## 87  -0.06412974
## 88  -0.19763757
## 89  -0.15262578
## 90  -0.15322440
## 91  -0.09463548
## 92  -0.28128638
## 93  -0.21996719
## 94  -0.15843589
## 95  -0.06412974
## 96  -0.19763757
## 97  -0.15262578
## 98  -0.15322440
## 99  -0.09463548
## 100 -0.28128638
## 101 -0.21996719
## 102 -0.15843589
## 103 -0.06412974
## 104 -0.19763757
## 105 -0.15262578
## 106 -0.15322440
## 107 -0.09463548
## 108 -0.28128638
## 109 -0.21996719
## 110 -0.15843589
## 111 -0.06412974
## 112 -0.19763757
## 113 -0.15262578
## 114 -0.15322440
## 115 -0.09463548
## 116 -0.28128638
## 117 -0.21996719
## 118 -0.15843589
## 119 -0.06412974
## 120 -0.19763757
## 121 -0.15262578
## 122 -0.15322440
## 123 -0.09463548
## 124 -0.28128638
## 125 -0.21996719
## 126 -0.15843589
## 127 -0.06412974
## 128 -0.19763757
## 129 -0.15262578
## 130 -0.15322440
## 131 -0.09463548
## 132 -0.28128638
## 133 -0.21996719
## 134 -0.15843589
## 135 -0.06412974
## 136 -0.19763757
## 137 -0.15262578
## 138 -0.15322440
## 139 -0.09463548
## 140 -0.28128638
## 141 -0.21996719
## 142 -0.15843589
## 143 -0.06412974
## 144 -0.19763757
## 145 -0.15262578
## 146 -0.15322440
## 147 -0.09463548
## 148 -0.28128638
## 149 -0.21996719
## 150 -0.15843589
## 151  1.00000000
## 152  0.00000000
## 153  1.00000000
## 154  1.00000000
oprint(summary(population,"mean"))
##    Gender       Age    mean
## 1  Female     0 - 4  125040
## 2    Male     0 - 4  130884
## 3  Female   10 - 14  151113
## 4    Male   10 - 14  157712
## 5  Female   15 - 19  144441
## 6    Male   15 - 19  152230
## 7  Female   20 - 24  152265
## 8    Male   20 - 24  161679
## 9  Female   25 - 29  172593
## 10   Male   25 - 29  183092
## 11 Female   30 - 34  169653
## 12   Male   30 - 34  181115
## 13 Female   35 - 39  174660
## 14   Male   35 - 39  186122
## 15 Female   40 - 44  168547
## 16   Male   40 - 44  177928
## 17 Female   45 - 49  154391
## 18   Male   45 - 49  159982
## 19 Female     5 - 9  149633
## 20   Male     5 - 9  156654
## 21 Female   50 - 54  176612
## 22   Male   50 - 54  179182
## 23 Female   55 - 59  185152
## 24   Male   55 - 59  183719
## 25 Female   60 - 64  183336
## 26   Male   60 - 64  176283
## 27 Female   65 - 69  185685
## 28   Male   65 - 69  171275
## 29 Female   70 - 74  186034
## 30   Male   70 - 74  163697
## 31 Female   75 - 79  118190
## 32   Male   75 - 79   93987
## 33 Female   80 - 84   96256
## 34   Male   80 - 84   65140
## 35 Female       85+  103429
## 36   Male       85+   47581
## 37 Female Undefined 2797030
## 38   Male Undefined 2728262
oprint(summary(RR,"mean"))
##     Exposure_agent            Response   ER_function Scaling Scenario Gender
## 1             Fish All-cause mortality            RR    None      BAU Female
## 2           Omega3       Breast cancer            RR    None      BAU Female
## 3             Fish          Depression            RR    None      BAU Female
## 4           Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 5             Fish All-cause mortality            RR    None      BAU   Male
## 6           Omega3       Breast cancer            RR    None      BAU   Male
## 7             Fish          Depression            RR    None      BAU   Male
## 8           Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 9             Fish All-cause mortality            RR    None      BAU Female
## 10          Omega3       Breast cancer            RR    None      BAU Female
## 11            Fish          Depression            RR    None      BAU Female
## 12          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 13            Fish All-cause mortality            RR    None      BAU   Male
## 14          Omega3       Breast cancer            RR    None      BAU   Male
## 15            Fish          Depression            RR    None      BAU   Male
## 16          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 17            Fish All-cause mortality            RR    None      BAU Female
## 18          Omega3       Breast cancer            RR    None      BAU Female
## 19            Fish          Depression            RR    None      BAU Female
## 20          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 21            Fish All-cause mortality            RR    None      BAU   Male
## 22          Omega3       Breast cancer            RR    None      BAU   Male
## 23            Fish          Depression            RR    None      BAU   Male
## 24          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 25            Fish All-cause mortality            RR    None      BAU Female
## 26          Omega3       Breast cancer            RR    None      BAU Female
## 27            Fish          Depression            RR    None      BAU Female
## 28          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 29            Fish All-cause mortality            RR    None      BAU   Male
## 30          Omega3       Breast cancer            RR    None      BAU   Male
## 31            Fish          Depression            RR    None      BAU   Male
## 32          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 33            Fish All-cause mortality            RR    None      BAU Female
## 34          Omega3       Breast cancer            RR    None      BAU Female
## 35            Fish          Depression            RR    None      BAU Female
## 36          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 37            Fish All-cause mortality            RR    None      BAU   Male
## 38          Omega3       Breast cancer            RR    None      BAU   Male
## 39            Fish          Depression            RR    None      BAU   Male
## 40          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 41            Fish All-cause mortality            RR    None      BAU Female
## 42          Omega3       Breast cancer            RR    None      BAU Female
## 43            Fish          Depression            RR    None      BAU Female
## 44          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 45            Fish All-cause mortality            RR    None      BAU   Male
## 46          Omega3       Breast cancer            RR    None      BAU   Male
## 47            Fish          Depression            RR    None      BAU   Male
## 48          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 49            Fish All-cause mortality            RR    None      BAU Female
## 50          Omega3       Breast cancer            RR    None      BAU Female
## 51            Fish          Depression            RR    None      BAU Female
## 52          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 53            Fish All-cause mortality            RR    None      BAU   Male
## 54          Omega3       Breast cancer            RR    None      BAU   Male
## 55            Fish          Depression            RR    None      BAU   Male
## 56          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 57            Fish All-cause mortality            RR    None      BAU Female
## 58          Omega3       Breast cancer            RR    None      BAU Female
## 59            Fish          Depression            RR    None      BAU Female
## 60          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 61            Fish All-cause mortality            RR    None      BAU   Male
## 62          Omega3       Breast cancer            RR    None      BAU   Male
## 63            Fish          Depression            RR    None      BAU   Male
## 64          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 65            Fish All-cause mortality            RR    None      BAU Female
## 66          Omega3       Breast cancer            RR    None      BAU Female
## 67            Fish          Depression            RR    None      BAU Female
## 68          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 69            Fish All-cause mortality            RR    None      BAU   Male
## 70          Omega3       Breast cancer            RR    None      BAU   Male
## 71            Fish          Depression            RR    None      BAU   Male
## 72          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 73            Fish All-cause mortality            RR    None      BAU Female
## 74          Omega3       Breast cancer            RR    None      BAU Female
## 75            Fish          Depression            RR    None      BAU Female
## 76          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 77            Fish All-cause mortality            RR    None      BAU   Male
## 78          Omega3       Breast cancer            RR    None      BAU   Male
## 79            Fish          Depression            RR    None      BAU   Male
## 80          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 81            Fish All-cause mortality            RR    None      BAU Female
## 82          Omega3       Breast cancer            RR    None      BAU Female
## 83            Fish          Depression            RR    None      BAU Female
## 84          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 85            Fish All-cause mortality            RR    None      BAU   Male
## 86          Omega3       Breast cancer            RR    None      BAU   Male
## 87            Fish          Depression            RR    None      BAU   Male
## 88          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 89            Fish All-cause mortality            RR    None      BAU Female
## 90          Omega3       Breast cancer            RR    None      BAU Female
## 91            Fish          Depression            RR    None      BAU Female
## 92          Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 93            Fish All-cause mortality            RR    None      BAU   Male
## 94          Omega3       Breast cancer            RR    None      BAU   Male
## 95            Fish          Depression            RR    None      BAU   Male
## 96          Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 97            Fish All-cause mortality            RR    None      BAU Female
## 98          Omega3       Breast cancer            RR    None      BAU Female
## 99            Fish          Depression            RR    None      BAU Female
## 100         Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 101           Fish All-cause mortality            RR    None      BAU   Male
## 102         Omega3       Breast cancer            RR    None      BAU   Male
## 103           Fish          Depression            RR    None      BAU   Male
## 104         Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 105           Fish All-cause mortality            RR    None      BAU Female
## 106         Omega3       Breast cancer            RR    None      BAU Female
## 107           Fish          Depression            RR    None      BAU Female
## 108         Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 109           Fish All-cause mortality            RR    None      BAU   Male
## 110         Omega3       Breast cancer            RR    None      BAU   Male
## 111           Fish          Depression            RR    None      BAU   Male
## 112         Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 113           Fish All-cause mortality            RR    None      BAU Female
## 114         Omega3       Breast cancer            RR    None      BAU Female
## 115           Fish          Depression            RR    None      BAU Female
## 116         Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 117           Fish All-cause mortality            RR    None      BAU   Male
## 118         Omega3       Breast cancer            RR    None      BAU   Male
## 119           Fish          Depression            RR    None      BAU   Male
## 120         Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 121           Fish All-cause mortality            RR    None      BAU Female
## 122         Omega3       Breast cancer            RR    None      BAU Female
## 123           Fish          Depression            RR    None      BAU Female
## 124         Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 125           Fish All-cause mortality            RR    None      BAU   Male
## 126         Omega3       Breast cancer            RR    None      BAU   Male
## 127           Fish          Depression            RR    None      BAU   Male
## 128         Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 129           Fish All-cause mortality            RR    None      BAU Female
## 130         Omega3       Breast cancer            RR    None      BAU Female
## 131           Fish          Depression            RR    None      BAU Female
## 132         Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 133           Fish All-cause mortality            RR    None      BAU   Male
## 134         Omega3       Breast cancer            RR    None      BAU   Male
## 135           Fish          Depression            RR    None      BAU   Male
## 136         Omega3      CHD2 mortality Relative Hill    None      BAU   Male
## 137           Fish All-cause mortality            RR    None      BAU Female
## 138         Omega3       Breast cancer            RR    None      BAU Female
## 139           Fish          Depression            RR    None      BAU Female
## 140         Omega3      CHD2 mortality Relative Hill    None      BAU Female
## 141           Fish All-cause mortality            RR    None      BAU   Male
## 142         Omega3       Breast cancer            RR    None      BAU   Male
## 143           Fish          Depression            RR    None      BAU   Male
## 144         Omega3      CHD2 mortality Relative Hill    None      BAU   Male
##         Age      mean
## 1     0 - 4 0.9358703
## 2     0 - 4 0.8023624
## 3     0 - 4 0.8473742
## 4     0 - 4 0.8467756
## 5     0 - 4 0.9053645
## 6     0 - 4 0.7187136
## 7     0 - 4 0.7800328
## 8     0 - 4 0.8415641
## 9   10 - 14 0.9358703
## 10  10 - 14 0.8023624
## 11  10 - 14 0.8473742
## 12  10 - 14 0.8467756
## 13  10 - 14 0.9053645
## 14  10 - 14 0.7187136
## 15  10 - 14 0.7800328
## 16  10 - 14 0.8415641
## 17  15 - 19 0.9358703
## 18  15 - 19 0.8023624
## 19  15 - 19 0.8473742
## 20  15 - 19 0.8467756
## 21  15 - 19 0.9053645
## 22  15 - 19 0.7187136
## 23  15 - 19 0.7800328
## 24  15 - 19 0.8415641
## 25  20 - 24 0.9358703
## 26  20 - 24 0.8023624
## 27  20 - 24 0.8473742
## 28  20 - 24 0.8467756
## 29  20 - 24 0.9053645
## 30  20 - 24 0.7187136
## 31  20 - 24 0.7800328
## 32  20 - 24 0.8415641
## 33  25 - 29 0.9358703
## 34  25 - 29 0.8023624
## 35  25 - 29 0.8473742
## 36  25 - 29 0.8467756
## 37  25 - 29 0.9053645
## 38  25 - 29 0.7187136
## 39  25 - 29 0.7800328
## 40  25 - 29 0.8415641
## 41  30 - 34 0.9358703
## 42  30 - 34 0.8023624
## 43  30 - 34 0.8473742
## 44  30 - 34 0.8467756
## 45  30 - 34 0.9053645
## 46  30 - 34 0.7187136
## 47  30 - 34 0.7800328
## 48  30 - 34 0.8415641
## 49  35 - 39 0.9358703
## 50  35 - 39 0.8023624
## 51  35 - 39 0.8473742
## 52  35 - 39 0.8467756
## 53  35 - 39 0.9053645
## 54  35 - 39 0.7187136
## 55  35 - 39 0.7800328
## 56  35 - 39 0.8415641
## 57  40 - 44 0.9358703
## 58  40 - 44 0.8023624
## 59  40 - 44 0.8473742
## 60  40 - 44 0.8467756
## 61  40 - 44 0.9053645
## 62  40 - 44 0.7187136
## 63  40 - 44 0.7800328
## 64  40 - 44 0.8415641
## 65  45 - 49 0.9358703
## 66  45 - 49 0.8023624
## 67  45 - 49 0.8473742
## 68  45 - 49 0.8467756
## 69  45 - 49 0.9053645
## 70  45 - 49 0.7187136
## 71  45 - 49 0.7800328
## 72  45 - 49 0.8415641
## 73    5 - 9 0.9358703
## 74    5 - 9 0.8023624
## 75    5 - 9 0.8473742
## 76    5 - 9 0.8467756
## 77    5 - 9 0.9053645
## 78    5 - 9 0.7187136
## 79    5 - 9 0.7800328
## 80    5 - 9 0.8415641
## 81  50 - 54 0.9358703
## 82  50 - 54 0.8023624
## 83  50 - 54 0.8473742
## 84  50 - 54 0.8467756
## 85  50 - 54 0.9053645
## 86  50 - 54 0.7187136
## 87  50 - 54 0.7800328
## 88  50 - 54 0.8415641
## 89  55 - 59 0.9358703
## 90  55 - 59 0.8023624
## 91  55 - 59 0.8473742
## 92  55 - 59 0.8467756
## 93  55 - 59 0.9053645
## 94  55 - 59 0.7187136
## 95  55 - 59 0.7800328
## 96  55 - 59 0.8415641
## 97  60 - 64 0.9358703
## 98  60 - 64 0.8023624
## 99  60 - 64 0.8473742
## 100 60 - 64 0.8467756
## 101 60 - 64 0.9053645
## 102 60 - 64 0.7187136
## 103 60 - 64 0.7800328
## 104 60 - 64 0.8415641
## 105 65 - 69 0.9358703
## 106 65 - 69 0.8023624
## 107 65 - 69 0.8473742
## 108 65 - 69 0.8467756
## 109 65 - 69 0.9053645
## 110 65 - 69 0.7187136
## 111 65 - 69 0.7800328
## 112 65 - 69 0.8415641
## 113 70 - 74 0.9358703
## 114 70 - 74 0.8023624
## 115 70 - 74 0.8473742
## 116 70 - 74 0.8467756
## 117 70 - 74 0.9053645
## 118 70 - 74 0.7187136
## 119 70 - 74 0.7800328
## 120 70 - 74 0.8415641
## 121 75 - 79 0.9358703
## 122 75 - 79 0.8023624
## 123 75 - 79 0.8473742
## 124 75 - 79 0.8467756
## 125 75 - 79 0.9053645
## 126 75 - 79 0.7187136
## 127 75 - 79 0.7800328
## 128 75 - 79 0.8415641
## 129 80 - 84 0.9358703
## 130 80 - 84 0.8023624
## 131 80 - 84 0.8473742
## 132 80 - 84 0.8467756
## 133 80 - 84 0.9053645
## 134 80 - 84 0.7187136
## 135 80 - 84 0.7800328
## 136 80 - 84 0.8415641
## 137     85+ 0.9358703
## 138     85+ 0.8023624
## 139     85+ 0.8473742
## 140     85+ 0.8467756
## 141     85+ 0.9053645
## 142     85+ 0.7187136
## 143     85+ 0.7800328
## 144     85+ 0.8415641
###################
# Graphs
trim <- function(ova) return(oapply(ova, NULL, mean, "Iter")@output)

ggplot(amount@output, aes(x=Gender, weight=amountResult, fill=Kala))+geom_bar()+
  labs(
    title="Kalansyönti Suomessa ikäryhmittäin",
    y="Syönti (g/d)"
  )

ggsave("Kalansyönti Suomessa ikäryhmittäin.svg")
## Saving 7 x 5 in image
plot_ly(trim(total_amount), x=~Kala, y=~total_amountResult, color=~Kala, type="bar") %>%
  layout(yaxis=list(title="Kalan kokonaiskulutus Suomessa (milj kg /a)"), barmode="stack")
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
plot_ly(trim(conc_vit), x=~Nutrient, y=~conc_vitResult, color=~Kala, type="scatter", mode="markers") %>%
  layout(yaxis=list(title="Concentrations of nutrients (mg or ug /g)"))
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
ggplot(conc_pfas@output, aes(x=Fish, y=conc_pfasResult))+geom_point() # Inputed data for missing species.

ggplot(conc_pfas@output, aes(x=conc_pfasResult, color=Compound, linetype=Area))+stat_ecdf()+
  scale_x_log10()+
  stat_ecdf(data=conc_eukalat@output, aes(x=conc_eukalatResult))+
  scale_linetype_manual(values=c("dotted","solid","twodash"))+
  labs(
    title="PFAS concentration in fishes in Finland",
    x="PFAS concentration (ng/g fresh weight)",
    y="Cumulative probability"
  )

# The code may produce some negative values, which are removed from the graph
ggsave("PFAS-pitoisuus kalassa Suomessa.svg")
## Saving 7 x 5 in image
ggplot(conc@output, aes(x=concResult, colour=Fish))+stat_ecdf()+
  facet_wrap(~Compound, scales="free_x")

#ggplot(oapply(expo_dir, cols=c("Iter"),FUN=mean)@output,
#       aes(x=Gender, weight=expo_dirResult,fill=Fish))+geom_bar()+
#  facet_wrap(~Compound, scales="free_y")+
#  labs(title="Eri yhdisteiden saanti kalasta")
#ggsave("Yhdisteiden saanti kalasta Suomessa.svg")

tmp <- exposure #/ Ovariable(
#  output = data.frame(
#    Exposure_agent = c("Fish","Vitamin D", "Omega3", "ALA", "DHA", "TEQ", "PFAS"),
#    Result = c(1, 1, 1000, 1000, 1000, 1, 1)
#  ),
#  marginal = c(TRUE, FALSE)
#)

plot_ly(trim(tmp), x=~exposureSource, y=~exposureResult, color=~Exposure_agent, text=~Exposure_agent, type="bar") %>%
  layout(yaxis=list(title="Exposure to nutrients (g or ug /d)"))
ggplot(exposure@output, aes(x=Gender, weight=exposureResult, fill=Gender))+geom_bar()+
  facet_wrap(~Exposure_agent, scales="free_y")+
  labs(
    title="Exposure to compounds",
    y="(omega: mg/d; vit D: ug/d, PFAS: ng/d)"
  )

cat("Kalaperäisiä tautitaakkoja Suomessa\n")
## Kalaperäisiä tautitaakkoja Suomessa
if(openv$N>1) {
  tmp <- summary(oapply(BoDattr,NULL,sum,c("Age","Gender","Response")))
  tmp <- data.frame(
    Altiste = tmp$Exposure_agent,
    Vaikutus = tmp$Response,
    Keskiarvo = as.character(signif(tmp$mean,2)),
    "95 luottamusväli" = paste0(signif(tmp$Q0.025,2)," - ", signif(tmp$Q0.975,2)),
    Keskihajonta = signif(tmp$sd,2)
  )#[rev(match(lev, tmp$Exposure_agent)),]

  oprint(tmp)
  
  tmp <- summary(oapply(BoDattr,NULL,sum,c("Age","Gender","Exposure_agent")))
  tmp <- data.frame(
    Terveysvaikutus = tmp$Response,
    Keskiarvo = signif(tmp$mean,2),
    "95 luottamusväli" = paste0(signif(tmp$Q0.025,2)," - ", signif(tmp$Q0.975,2)),
    Keskihajonta = signif(tmp$sd,2)
  )
  oprint(tmp)
}

ggplot(trim(BoDattr), aes(x=Exposure_agent, weight=BoDattrResult, fill=Response))+geom_bar()

ggplot(trim(BoDattr), aes(x=Response, weight=BoDattrResult, fill=Exposure_agent))+geom_bar()

plot_ly(trim(BoDattr), x=~Exposure_agent, y=~BoDattrResult, color=~Response, text=~paste(Age, Exposure_agent, sep=": "), type="bar") %>%
  layout(yaxis=list(title="Disease burden (DALY /a); CHD2=coronary heart disease"), barmode="stack")
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors

## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
################ Insight network
gr <- scrape(type="assessment")
objects.latest("Op_en3861", "makeGraph") # [[Insight network]]
## Loading objects:
##   makeGraph
gr <- makeGraph(gr)
## Loading required package: DiagrammeR
## Loading objects:
##   formatted
## Loading objects:
##   chooseGr
#export_graph(gr, "ruori.svg")
#render_graph(gr) # Does not work: Error in generate_dot(graph) : object 'attribute' not found
##################### Diagnostics
objects.latest("Op_en6007", code_name="diagnostics")
## Loading objects:
##   showind
##   binoptest
##   showLoctable
##   ovashapetest
showLoctable()
showind()
## subgrouping is not an ovariable.
## sumExposcen is not an ovariable.
## mc2d is not an ovariable.
## mc2dparam is not an ovariable.